This dataset contains the revised PSFs for the Atmospheric Imaging Assembly (AIA) onboard the Solar Dynamics Observatory (SDO). 
If you use them, please cite   
     
     Hofmeister, Savin, Hahn, (2024). Revised Point-Spread Functions for the Atmospheric Imaging Assembly onboard the Solar Dynamics Observatory. ArXiv:2410.08967. Submitted to the Astrophysical Journal Supplement Series.
     
Each PSF has a dimension of 8192 x 8192 pixels. By that, they describe diffraction and scattering over the entire field of view of AIA. 
Due to their large size and the long-range scattering, the usually used Richardson Lucy algorithm should not be used to deconvolve AIA images for these PSFs. Instead, we have prepared a set of Python and IDL routines, which can be used as in-line replacement for the Richardson Lucy algorithm. These handle the long-distance scattered light correctly. These Tools are available at

    https://github.com/stefanhofmeister/PSF-Tools

and described in 

    Hofmeister (2024). The Basic Iterative Deconvolution: A Fast Instrumental Point-Spread Function Deconvolution Method That Corrects for Light That Is Scattered Out of the Field of View of a Detector. Solar Physics, Volume 299, Issue 6, id.77. DOI: 10.1007/s11207-024-02321-y
    
In the following, we shortly describe how to use these algorithms. 

For Python:
    # First, add the file deconvolve_image.py from my Github repository to your project.
    # Load the modules
    import numpy as np
    import copy
    import sunpy.map
    from astropy.nddata import CCDData
    from deconvolve_image import deconvolve_bid
    from rebin_psf import rebin_psf

    # Read the PSF and the AIA image
    psf = CCDData.read(psf_file)
    aia_data = sunpy.map.Map(aia_file).data.astype(float)

    # There are 3 ways to deconvolve the image.
    # 1. Deconvolve the image the full image. If you want to do the deconvolution on the GPU, be aware that this deconvolution might need a lot of GPU RAM. 
    aia_dec = deconvolve_bid(aia_data, psf, large_psf = True, use_gpu = True/False)

    # 2. Or deconvolve a subfield to speed up the computation, specify the edges of the subfield in pixel coordinates or by providing a mask. Note that currently the subfield has to be smaller than half the AIA image size. Assuming that the subfield of interest is [left, bottom, right, top] = [100, 800, 100, 800]:
    aia_dec = deconvolve_bid(aia_data, psf, large_psf = True, use_gpu = True/False, mask = [100, 800, 100, 800])

    # 3. Or rebin the image and psf before deconvolving. Let's assume we want to bin the image and PSF by a factor of 4 and then deconvolve the image. 
    aia_data_rebinned = aiamap.superpixel([4, 4] *u.pix).data.astype(float)
    psf_rebinned = rebin_psf(psf, np.array(psf.shape)//4)
    aia_dec = deconvolve_bid(aia_data_rebinned, psf_rebinned, large_psf = True, use_gpu = True/False)

    # Create a new sunpy.map structure for the deconvolved image
    aiamap_dec = aiamap._new_instance(aia_dec, copy.deepcopy(aiamap.meta), plot_settings=copy.deepcopy(aiamap.plot_settings), mask=aiamap.mask)
    
For IDL:
    # Add the file deconvolve_bid.pro from my Github repository to your project
    # Read the PSF and the AIA image. We use read_sdo and mreadfits here. But you can also use fits2map or similar routines. Important, you are only allow to apply aia_prep after the deconvolution, not before.
    mreadfits, psf_file, psf_header, psf
    read_sdo, aia_file, aia_header, aia_data

    # Deconvolve the image. It can be used the same way as for the python routines. However, there is no GPU support. 
    aia_dec = deconvolve_image(aia_data, psf, large_psf = True)

    # Then do the aia_prep and create a map
    aia_prep, aia_header, aia_dec, aia_header_prepped, aia_dec_prepped
    index2map, aia_header_prepped, aia_dec_prepped, aiamap_prepped
    
    
    
